#!/bin/sh
# @configure_input@
#
# Checkinstall - perform preinstallation install checks.
#
# This is a modified version of a script written by mark@metalab.unc.edu .
# The original is at http://metalab.unc.edu/pub/packages/solaris/sparc/html/creating.solaris.packages.html .
#

PKG_CONFIG=@PKG_CONFIG@

gtk_version_needed="2.0"
expected_platform="@host_cpu@"

platform=`uname -p`

if [ ${platform} != ${expected_platform} ]
then
  echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
  echo "\tAborting installation.\n\n\n"
  exit 1
fi

if [ ! -x "$PKG_CONFIG" ]
then
	# We couldn't find GTK in the location that was used to build
	# Wireshark.
	# Punt!
	# If gtk-config is in the $PATH then wireshark should install fine.
	# Some modifications to $LD_LIBRARY_PATH (or non Solaris equivalent)
	# may be required by the user.  Should there be a warning here?
	PKG_CONFIG=pkg-config
fi

$PKG_CONFIG gtk+-2.0 --atleast-version=$gtk_version_needed
if [ $? != 0 ]
then
	echo "\n\n\n\tThis package requires gtk+-2 version >= $gtk_version_needed installed in `dirname @PKG_CONFIG@`."
	echo "\tAborting installation.\n\n\n"
	exit 1
fi

exit 0
